#ifndef LIGHT_H
#define LIGHT_H
#include "example.h"
#include "CH395.h"
#include "CH395CMD.h"
#include "crc16.h"
#define  LIGHT_MAX  192

typedef struct Light             //灯结构体
{
  uint8_t light_address[3];        //灯地址
  uint8_t crowd_num;               //群号
  uint8_t group_num;               //组号
  uint8_t Tag_num;                 //位号
  uint8_t mode;                    //模式
  uint8_t period[2];               //周期
  uint8_t color;                   //颜色
  uint8_t gb2312Code[2];           //字符
  uint8_t version[4];              //固件版本
  uint8_t rssi;                    //灯rssi值
  uint8_t heart_cnt;               //收到灯心跳
}s_light;



void         light_init(void);
uint8_t      add_light(s_light* light);   //如果当前灯为新灯，则返回1，否则返回0
void         upload_light(uint8_t *network_buffer);
s_light*     need_to_sync(s_light *light);
#endif